package com.fwzhang.util;

import tech.tablesaw.api.Table;

import java.io.IOException;
import java.util.Objects;

public class CsvToExcelUtil {

    public static Table readCsv(String filePath) {
        try {
            return Table.read().csv(filePath);

        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

    public static void main(String[] args) {
        Table table = readCsv("C:\\Users\\Magfin\\Desktop\\人员花名册.csv");
        if (Objects.nonNull(table)) {
            System.out.println(table.print());
        }
    }

}
